<?php defined('SYSPATH') or die('No direct script access.');

class Model_Price extends ORM
{  
    protected $_reload_on_wakeup = false;
    
    public function get_available_prices()
    {
        return array(
            array('from' => null,  'to' => 3000),
            array('from' => 3000,  'to' => 7000),
            array('from' => 7000,  'to' => 10000),
            array('from' => 10000, 'to' => 15000),
            array('from' => 15000, 'to' => null),
        );
    }
    
    public function get_prices(Model_Model $model)
    {
        // TODO cache
        $prices = ORM::factory('price')
                ->where('model_id', '=', $model->id)
                ->find_all()
                ->as_array();       
        return $prices;
    }
    
}